/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package data;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Mr. Tam
 */
@Entity
@Table(name = "Staff_Role")
@NamedQueries({
    @NamedQuery(name = "StaffRole.findAll", query = "SELECT s FROM StaffRole s"),
    @NamedQuery(name = "StaffRole.findByStaffRoleId", query = "SELECT s FROM StaffRole s WHERE s.staffRoleId = :staffRoleId"),
    @NamedQuery(name = "StaffRole.findByStaffRoleName", query = "SELECT s FROM StaffRole s WHERE s.staffRoleName = :staffRoleName"),
    @NamedQuery(name = "StaffRole.findByStaffRoleDescription", query = "SELECT s FROM StaffRole s WHERE s.staffRoleDescription = :staffRoleDescription")})
public class StaffRole implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "staff_role_id")
    private Integer staffRoleId;
    @Column(name = "staff_role_name")
    private String staffRoleName;
    @Column(name = "staff_role_description")
    private String staffRoleDescription;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "staffRole")
    private List<Staff> staffList;

    public StaffRole() {
    }

    public StaffRole(Integer staffRoleId) {
        this.staffRoleId = staffRoleId;
    }

    public Integer getStaffRoleId() {
        return staffRoleId;
    }

    public void setStaffRoleId(Integer staffRoleId) {
        this.staffRoleId = staffRoleId;
    }

    public String getStaffRoleName() {
        return staffRoleName;
    }

    public void setStaffRoleName(String staffRoleName) {
        this.staffRoleName = staffRoleName;
    }

    public String getStaffRoleDescription() {
        return staffRoleDescription;
    }

    public void setStaffRoleDescription(String staffRoleDescription) {
        this.staffRoleDescription = staffRoleDescription;
    }

    public List<Staff> getStaffList() {
        return staffList;
    }

    public void setStaffList(List<Staff> staffList) {
        this.staffList = staffList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (staffRoleId != null ? staffRoleId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StaffRole)) {
            return false;
        }
        StaffRole other = (StaffRole) object;
        if ((this.staffRoleId == null && other.staffRoleId != null) || (this.staffRoleId != null && !this.staffRoleId.equals(other.staffRoleId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "data.StaffRole[staffRoleId=" + staffRoleId + "]";
    }

}
